clear
version 7.0
#delimit ;
cd "Z:\interactionmodels\";                       * SET WORKING DIRECTORY;
log using replication\electoralparties_replication.log, replace;

*     ***************************************************************** *;
*     ***************************************************************** *;
*       File-Name:      electoralparties_replication.do                 *;
*       Date:           01/09/2007                                      *;
*       Author:         MRG                                             *;
*       Purpose:        Replicate Mozaffar et al. 2003, table 1         *;
*       Input File:     STATA_mozaffar.dta                              *;
*       Output File:    electoralparties_replication.log                *;
*       Data Output:    none                                            *;
*       Previous file:                                                  *;
*       Machine:                                                        *;
*     ****************************************************************  *;
*     ****************************************************************  *;

set mem 10m;

use getdata\STATA_mozaffar.dta;

*     ****************************************************************  *;
*           Summary Statistics                                          *;
*     ****************************************************************  *;

sum;

*     ****************************************************************  *;
*       First, try to replicate Model 1 in Table 1, page 386.           *;
*     ****************************************************************  *;

regress  elecparties logmag10 proximity prox_prescandidate;

regress  elecparties logmag proximity prox_prescandidate;

regress  elecparties logmag10 proximity prox_prescandidate, robust;

regress  elecparties logmag proximity prox_prescandidate, robust;

*     ****************************************************************  *;
*       Neither of these work                                           *;
*     ****************************************************************  *;


*     ****************************************************************  *;
*       Model 2                                                         *;
*     ****************************************************************  *;

regress elecparties fragmentation concentration frag_conc;

regress elecparties fragmentation concentration frag_conc, robust;

regress elecparties fragmentation2 concentration frag_conc;

regress elecparties fragmentation2 concentration frag_conc, robust;

regress elecparties fragmentation2 concentration frag2_conc;

regress elecparties fragmentation2 concentration frag2_conc, robust;

regress elecparties fragmentation fragmentation2 concentration frag2_conc, robust;

regress elecparties fragmentation fragmentation2 concentration frag_conc, robust;

*     ****************************************************************  *;
*       Could not replicate either, but closest one was with            *;
*       fragmentation2 and frag2_conc.                                  *;
*     ****************************************************************  *;

*     ****************************************************************  *;
*       Model 3                                                         *;
*     ****************************************************************  *;

regress elecparties logmag10 proximity prox_prescandidate fragmentation concentration frag_conc;

regress elecparties logmag10 proximity prox_prescandidate fragmentation concentration frag_conc, robust;

regress elecparties logmag proximity prox_prescandidate fragmentation concentration frag_conc;

regress elecparties logmag proximity prox_prescandidate fragmentation concentration frag_conc, robust;

regress elecparties logmag10 proximity prox_prescandidate fragmentation2 concentration frag_conc;

regress elecparties logmag10 proximity prox_prescandidate fragmentation2 concentration frag_conc, robust;

regress elecparties logmag10 proximity prox_prescandidate fragmentation2 concentration frag2_conc;

regress elecparties logmag10 proximity prox_prescandidate fragmentation2 concentration frag2_conc, robust;

regress elecparties logmag proximity prox_prescandidate fragmentation2 concentration frag_conc;

regress elecparties logmag proximity prox_prescandidate fragmentation2 concentration frag_conc, robust;

regress elecparties logmag proximity prox_prescandidate fragmentation2 concentration frag2_conc;

regress elecparties logmag proximity prox_prescandidate fragmentation2 concentration frag2_conc, robust;

regress elecparties logmag10 proximity prox_prescandidate fragmentation2 concentration frag2_conc, robust;

*     ****************************************************************  *;
*       Could not replicate - but last equation is closest.             *;
*     ****************************************************************  *;

*     ****************************************************************  *;
*                               Model 4                                 *;
*     ****************************************************************  *;

regress  elecparties logmag10 proximity prox_prescandidate fragmentation concentration logmag10_frag_conc;

regress  elecparties logmag10 proximity prox_prescandidate fragmentation concentration logmag10_frag_conc, robust;

regress  elecparties logmag10 proximity prox_prescandidate fragmentation2 concentration logmag10_frag_conc;

regress  elecparties logmag10 proximity prox_prescandidate fragmentation2 concentration logmag10_frag_conc, robust;

regress  elecparties logmag10 proximity prox_prescandidate fragmentation2 concentration logmag10_frag2_conc;

regress  elecparties logmag10 proximity prox_prescandidate fragmentation2 concentration logmag10_frag2_conc, robust;

regress  elecparties logmag proximity prox_prescandidate fragmentation concentration logmag_frag_conc;

regress  elecparties logmag proximity prox_prescandidate fragmentation concentration logmag_frag_conc, robust;

regress  elecparties logmag proximity prox_prescandidate fragmentation2 concentration logmag_frag_conc;

regress  elecparties logmag proximity prox_prescandidate fragmentation2 concentration logmag_frag_conc, robust;

gen logmag_frag2_conc = logmag*fragmentation2*concentration;

label var logmag_frag2_conc "logmag*fragmentation2*concentration";

regress  elecparties logmag proximity prox_prescandidate fragmentation2 concentration logmag_frag2_conc;

regress  elecparties logmag proximity prox_prescandidate fragmentation2 concentration logmag_frag2_conc, robust;

*     ****************************************************************  *;
*      Again, not possible to replicate despite multiple configurations *;
*     ****************************************************************  *;

*     ****************************************************************  *;
*     ****************************************************************  *;
*     ****************************************************************  *;
*       These are the specifications that get us the closest to the     *;
*       results shown in Table 1.                                       *;
*     ****************************************************************  *;
*     ****************************************************************  *;
*     ****************************************************************  *;

*     ****************************************************************  *;
*                               Model 1                                 *;
*     ****************************************************************  *;

regress elecparties logmag10 proximity prox_prescandidate, robust;

*     ****************************************************************  *;
*                               Model 2                                 *;
*     ****************************************************************  *;

regress elecparties fragmentation2 concentration frag2_conc, robust;

*     ****************************************************************  *;
*                               Model 3                                 *;
*     ****************************************************************  *;

regress elecparties logmag10 proximity prox_prescandidate fragmentation2 concentration frag2_conc, robust;


*     ****************************************************************  *;
*                               Model 4                                 *;
*     ****************************************************************  *;

regress elecparties logmag10 proximity prox_prescandidate fragmentation2 concentration logmag10_frag2_conc, robust;

*     ****************************************************************  *;
*     ****************************************************************  *;
*     ****************************************************************  *;
*     ****************************************************************  *;
*                       Correct specifications                          *;
*     ****************************************************************  *;
*     ****************************************************************  *;
*     ****************************************************************  *;
*     ****************************************************************  *;

*     ****************************************************************  *;
*                               Model 1                                 *;
*     ****************************************************************  *;

regress elecparties logmag10 proximity prescandidate prox_prescandidate, robust;

*     ****************************************************************  *;
*                               Model 2                                 *;
*     ****************************************************************  *;

regress elecparties fragmentation fragmentation2 concentration frag_conc, robust;

*     ****************************************************************  *;
*                               Model 3                                 *;
*     ****************************************************************  *;

regress elecparties logmag10 proximity prescandidate prox_prescandidate fragmentation concentration frag_conc, robust;

*     ****************************************************************  *;
*                               Model 4                                 *;
*     ****************************************************************  *;

regress elecparties logmag10 proximity prescandidate prox_prescandidate fragmentation concentration
frag_conc logmag10_frag logmag10_conc logmag10_frag_conc, robust;

*     ****************************************************************  *;
*                       End of basic replication                        *;
*     ****************************************************************  *;

log close;
exit;
